import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export const constantRoutes = [
  {
    path: '/',
    name: '/',
    redirect: '/home',
    hidden: true,
    meta: { hidden: true }
  },
  {
    path: '/login',
    name: '/login',
    component: () => import('@/views/login1'),
    hidden: true,
    meta: { hidden: true }
  },
  {
    path: '/home',
    name: '/home',
    component: () => import('@/views/home'),
    hidden: true,
    meta: { hidden: true }
  },
  {
    path: '/home-elder',
    name: '/home-elder',
    component: () => import('@/views/homelder/index'),
    hidden: true,
    meta: { hidden: true }
  },
  {
    path: '/consulting',
    name: '/consulting',
    component: () => import('@/views/home/consulting'),
    hidden: true,
    meta: { hidden: true, title: '我要咨询' }
  },
  {
    path: '/consulting-elder',
    name: '/consulting-elder',
    component: () => import('@/views/homelder/consulting'),
    hidden: true,
    meta: { hidden: true, title: '我要咨询' }
  },
  {
    path: '/news',
    name: '/news',
    component: () => import('@/views/home/newsList'),
    hidden: true,
    meta: { hidden: true, title: '报批指导' }
  },
  {
    path: '/news-elder',
    name: '/news-elder',
    component: () => import('@/views/homelder/newsList'),
    hidden: true,
    meta: { hidden: true, title: '报批指导' }
  },
  {
    path: '/news-detail',
    name: '/news-detail',
    component: () => import('@/views/home/newsDetail'),
    hidden: true,
    meta: { hidden: true, title: '报批指导' }
  },
  {
    path: '/news-detail-elder',
    name: '/news-detail-elder',
    component: () => import('@/views/homelder/newsDetail'),
    hidden: true,
    meta: { hidden: true, title: '报批指导' }
  },
  {
    path: '/plan-change',
    name: '/plan-change',
    component: () => import('@/views/home/plan-change'),
    hidden: true,
    meta: { hidden: true, title: '计划变更' }
  },
  {
    path: '/out-problem',
    name: '/out-problem',
    component: () => import('@/views/home/out-problem'),
    hidden: true,
    meta: { hidden: true, title: '纾困解难' }
  },
  {
    path: '/out-problem-elder',
    name: '/out-problem-elder',
    component: () => import('@/views/homelder/out-problem'),
    hidden: true,
    meta: { hidden: true, title: '纾困解难' }
  },
  {
    path: '/policy-type',
    name: '/policy-type',
    component: () => import('@/views/home/policy-type'),
    hidden: true,
    meta: { hidden: true, title: '最新政策' }
  },
  {
    path: '/policy-type-elder',
    name: '/policy-type-elder',
    component: () => import('@/views/homelder/policy-type'),
    hidden: true,
    meta: { hidden: true, title: '最新政策' }
  },
  {
    path: '/policy',
    name: '/policy',
    component: () => import('@/views/home/policy'),
    hidden: true,
    meta: { hidden: true, title: '最新政策' }
  },
  {
    path: '/policy-elder',
    name: '/policy-elder',
    component: () => import('@/views/homelder/policy'),
    hidden: true,
    meta: { hidden: true, title: '最新政策' }
  },
  {
    path: '/policy-detail',
    name: '/policy-detail',
    component: () => import('@/views/home/policy-detail'),
    hidden: true,
    meta: { hidden: true, title: '政策详情' }
  },
  {
    path: '/policy-detail-elder',
    name: '/policy-detail-elder',
    component: () => import('@/views/homelder/policy-detail'),
    hidden: true,
    meta: { hidden: true, title: '政策详情' }
  },
  {
    path: '/my-problem',
    name: '/my-problem',
    component: () => import('@/views/home/my-problem'),
    hidden: true,
    meta: { hidden: true, title: '我有疑问' }
  },
  {
    path: '/my-problem-elder',
    name: '/my-problem-elder',
    component: () => import('@/views/homelder/my-problem'),
    hidden: true,
    meta: { hidden: true, title: '我有疑问' }
  },
  {
    path: '/call',
    name: '/call',
    component: () => import('@/views/home/call'),
    hidden: true,
    meta: { hidden: true, title: '外线联报' }
  },
  {
    path: '/call-elder',
    name: '/call-elder',
    component: () => import('@/views/homelder/call'),
    hidden: true,
    meta: { hidden: true, title: '外线联报' }
  },
  {
    path: '/mediation-home',
    name: '/mediation-home',
    component: () => import('@/views/home/mediation_home'),
    hidden: true,
    meta: { hidden: true, title: '掌上中介' }
  },
  {
    path: '/mediation-rank',
    name: '/mediation-rank',
    component: () => import('@/views/home/mediation_rank'),
    hidden: true,
    meta: { hidden: true, title: '中介排行' }
  },
  {
    path: '/mediation',
    name: '/mediation',
    component: () => import('@/views/home/mediation'),
    hidden: true,
    meta: { hidden: true, title: '掌上中介' }
  },
  {
    path: '/mediation-detail',
    name: '/mediation-detail',
    component: () => import('@/views/home/mediation-detail'),
    hidden: true,
    meta: { hidden: true, title: '中介详情' }
  },
  {
    path: '/my-mediation',
    name: '/my-mediation',
    component: () => import('@/views/my/mediation'),
    hidden: true,
    meta: { hidden: true, title: '中介详情' }
  },
  {
    path: '/myelder-mediation',
    name: '/myelder-mediation',
    component: () => import('@/views/myelder/mediation'),
    hidden: true,
    meta: { hidden: true, title: '中介详情' }
  },
  {
    path: '/mediation-home-elder',
    name: '/mediation-home-elder',
    component: () => import('@/views/homelder/mediation_home'),
    hidden: true,
    meta: { hidden: true, title: '掌上中介' }
  },
  {
    path: '/mediation-rank-elder',
    name: '/mediation-rank-elder',
    component: () => import('@/views/homelder/mediation_rank'),
    hidden: true,
    meta: { hidden: true, title: '中介排行' }
  },
  {
    path: '/mediation-elder',
    name: '/mediation-elder',
    component: () => import('@/views/homelder/mediation'),
    hidden: true,
    meta: { hidden: true, title: '掌上中介' }
  },
  {
    path: '/mediation-detail-elder',
    name: '/mediation-detail-elder',
    component: () => import('@/views/homelder/mediation-detail'),
    hidden: true,
    meta: { hidden: true, title: '中介详情' }
  },
  {
    path: '/my',
    name: '/my',
    component: () => import('@/views/my'),
    hidden: true,
    meta: { hidden: true, title: '我的' }
  },
  {
    path: '/my-elder',
    name: '/my-elder',
    component: () => import('@/views/myelder/index'),
    hidden: true,
    meta: { hidden: true, title: '我的' }
  },
  {
    path: '/help-handle-detail',
    name: '/help-handle-detail',
    component: () => import('@/views/home/help-handle'),
    hidden: true,
    meta: { hidden: true, title: '帮办详情' }
  },
  {
    path: '/help-handle-detail-elder',
    name: '/help-handle-detail-elder',
    component: () => import('@/views/homelder/help-handle'),
    hidden: true,
    meta: { hidden: true, title: '帮办详情' }
  },
  {
    path: '/my-help',
    name: '/my-help',
    component: () => import('@/views/my/help'),
    hidden: true,
    meta: { hidden: true, title: '我的帮扶' }
  },
  {
    path: '/my-help-elder',
    name: '/my-help-elder',
    component: () => import('@/views/myelder/help'),
    hidden: true,
    meta: { hidden: true, title: '我的帮扶' }
  },
  {
    path: '/help-detail',
    name: '/help-detail',
    component: () => import('@/views/my/help/help-detail'),
    hidden: true,
    meta: { hidden: true, title: '帮扶详情' }
  },
  {
    path: '/help-detail-elder',
    name: '/help-detail-elder',
    component: () => import('@/views/myelder/help/help-detail'),
    hidden: true,
    meta: { hidden: true, title: '帮扶详情' }
  },
  {
    path: '/build',
    name: '/build',
    component: () => import('@/views/my/build'),
    hidden: true,
    meta: { hidden: true, title: '施工招标' }
  },
  {
    path: '/my-qs',
    name: '/my-qs',
    component: () => import('@/views/my/qs'),
    hidden: true,
    meta: { hidden: true, title: '我的问题' }
  },
  {
    path: '/my-qs-elder',
    name: '/my-qs-elder',
    component: () => import('@/views/myelder/qs'),
    hidden: true,
    meta: { hidden: true, title: '我的问题' }
  },
  {
    path: '/qs-detail',
    name: '/qs-detail',
    component: () => import('@/views/my/qs-detail'),
    hidden: true,
    meta: { hidden: true, title: '我的问题详情' }
  },
  {
    path: '/qs-detail-elder',
    name: '/qs-detail-elder',
    component: () => import('@/views/myelder/qs-detail'),
    hidden: true,
    meta: { hidden: true, title: '我的问题详情' }
  },
  {
    path: '/evaluation',
    name: '/evaluation',
    component: () => import('@/views/my/evaluation2'),
    hidden: true,
    meta: { hidden: true, title: '中介评价' }
  },
  {
    path: '/evaluation-elder',
    name: '/evaluation-elder',
    component: () => import('@/views/myelder/evaluation2'),
    hidden: true,
    meta: { hidden: true, title: '中介评价' }
  },
  {
    path: '/evaluation-detail',
    name: '/evaluation-detail',
    component: () => import('@/views/my/evaluation2-detail'),
    hidden: true,
    meta: { hidden: true, title: '中介评价详情' }
  },
  {
    path: '/evaluation-detail-elder',
    name: '/evaluation-detail-elder',
    component: () => import('@/views/myelder/evaluation2-detail'),
    hidden: true,
    meta: { hidden: true, title: '中介评价详情' }
  },
  {
    path: '/evaluation-create',
    name: '/evaluation-create',
    component: () => import('@/views/my/evaluation2-create'),
    hidden: true,
    meta: { hidden: true, title: '中介评价' }
  },
  {
    path: '/evaluation-create-elder',
    name: '/evaluation-create-elder',
    component: () => import('@/views/myelder/evaluation2-create'),
    hidden: true,
    meta: { hidden: true, title: '中介评价' }
  },
  {
    path: '/my-evaluation',
    name: '/my-evaluation',
    component: () => import('@/views/my/evaluation'),
    hidden: true,
    meta: { hidden: true, title: '我的评价' }
  },
  {
    path: '/my-evaluation-elder',
    name: '/my-evaluation-elder',
    component: () => import('@/views/myelder/evaluation'),
    hidden: true,
    meta: { hidden: true, title: '我的评价' }
  },
  {
    path: '/my-evaluation-create',
    name: '/my-evaluation-create',
    component: () => import('@/views/my/evaluation-create'),
    hidden: true,
    meta: { hidden: true, title: '评价' }
  },
  {
    path: '/my-evaluation-create-elder',
    name: '/my-evaluation-create-elder',
    component: () => import('@/views/myelder/evaluation-create'),
    hidden: true,
    meta: { hidden: true, title: '评价' }
  },
  {
    path: '/my-project',
    name: '/my-project',
    component: () => import('@/views/my/project'),
    hidden: true,
    meta: { hidden: true, title: '我的项目' }
  },
  {
    path: '/my-project-elder',
    name: '/my-project-elder',
    component: () => import('@/views/myelder/project'),
    hidden: true,
    meta: { hidden: true, title: '我的项目' }
  },
  {
    path: '/project-detail',
    name: '/project-detail',
    component: () => import('@/views/my/project-detail'),
    hidden: true,
    meta: { hidden: true, title: '项目详情' }
  },
  {
    path: '/project-detail-elder',
    name: '/project-detail-elder',
    component: () => import('@/views/myelder/project-detail'),
    hidden: true,
    meta: { hidden: true, title: '项目详情' }
  },
  {
    path: '/project-process-detail',
    name: '/project-process-detail',
    component: () => import('@/views/my/project-process-detail'),
    hidden: true,
    meta: { hidden: true, title: '项目详情' }
  },
  {
    path: '/project-node',
    name: '/project-node',
    component: () => import('@/views/my/project-node'),
    hidden: true,
    meta: { hidden: true, title: '项目事项' }
  },
  {
    path: '/project-node-detail',
    name: '/project-node-detail',
    component: () => import('@/views/my/project-node-detail'),
    hidden: true,
    meta: { hidden: true, title: '事项基本信息' }
  },
  {
    path: '/my-consulting',
    name: '/my-consulting',
    component: () => import('@/views/my/consulting'),
    hidden: true,
    meta: { hidden: true, title: '我的咨询' }
  },
  {
    path: '/my-consulting-elder',
    name: '/my-consulting-elder',
    component: () => import('@/views/myelder/consulting'),
    hidden: true,
    meta: { hidden: true, title: '我的咨询' }
  },
  {
    path: '/consulting-detail',
    name: '/consulting-detail',
    component: () => import('@/views/my/consulting-detail'),
    hidden: true,
    meta: { hidden: true, title: '我的咨询详情' }
  },
  {
    path: '/consulting-detail-elder',
    name: '/consulting-detail-elder',
    component: () => import('@/views/myelder/consulting-detail'),
    hidden: true,
    meta: { hidden: true, title: '我的咨询详情' }
  },
  {
    path: '/project-code',
    name: '/project-code',
    component: () => import('@/views/my/project-code'),
    hidden: true,
    meta: { hidden: true, title: '授权二维码' }
  },
  {
    path: '/project-code-elder',
    name: '/project-code-elder',
    component: () => import('@/views/myelder/project-code'),
    hidden: true,
    meta: { hidden: true, title: '授权二维码' }
  },
  {
    path: '/project-auth',
    name: '/project-auth',
    component: () => import('@/views/my/project-auth'),
    hidden: true,
    meta: { hidden: true, title: '项目授权' }
  },
  {
    path: '/project-code2',
    name: '/project-code2',
    component: () => import('@/views/my/project-code2'),
    hidden: true,
    meta: { hidden: true, title: '项目投资码' }
  },
  {
    path: '/project-code2-elder',
    name: '/project-code2-elder',
    component: () => import('@/views/myelder/project-code2'),
    hidden: true,
    meta: { hidden: true, title: '项目投资码' }
  },
  {
    path: '/project-process',
    name: '/project-process',
    component: () => import('@/views/my/project-process'),
    hidden: true,
    meta: { hidden: true, title: '项目进度' }
  },
    {
        path: '/project-process-detail',
        name: '/project-process-detail',
        component: () => import('@/views/my/project-process-detail'),
        hidden: true,
        meta: { hidden: true, title: '项目详情' }
    },
  {
    path: '/data-package',
    name: '/data-package',
    component: () => import('@/views/home/data-package'),
    hidden: true,
    meta: { hidden: true, title: '数据礼包' }
  },
  {
    path: '/data-package-elder',
    name: '/data-package-elder',
    component: () => import('@/views/homelder/data-package'),
    hidden: true,
    meta: { hidden: true, title: '数据礼包' }
  },
  {
    path: '/data-package-detail',
    name: '/data-package-detail',
    component: () => import('@/views/home/data-package-detail'),
    hidden: true,
    meta: { hidden: true, title: '数据礼包详情' }
  },
  {
    path: '/data-package-detail-elder',
    name: '/data-package-detail-elder',
    component: () => import('@/views/homelder/data-package-detail'),
    hidden: true,
    meta: { hidden: true, title: '数据礼包详情' }
  },
  {
    path: '/space',
    name: '/space',
    component: () => import('@/views/home/space'),
    hidden: true,
    meta: { hidden: true, title: '助企空间' }
  },
  {
    path: '/space-elder',
    name: '/space-elder',
    component: () => import('@/views/homelder/space'),
    hidden: true,
    meta: { hidden: true, title: '助企空间' }
  },
  {
    path: '/space2',
    name: '/space2',
    component: () => import('@/views/home/space2'),
    hidden: true,
    meta: { hidden: true, title: '一键上门帮办' }
  },
  {
    path: '/space2-elder',
    name: '/space2-elder',
    component: () => import('@/views/homelder/space2'),
    hidden: true,
    meta: { hidden: true, title: '一键上门帮办' }
  },
  {
    path: '/projectwarn',
    name: '/projectwarn',
    component: () => import('@/views/my/projectwarn'),
    hidden: true,
    meta: { hidden: true, title: '项目预警' }
  },
  {
    path: '/projectwarn-elder',
    name: '/projectwarn-elder',
    component: () => import('@/views/myelder/projectwarn'),
    hidden: true,
    meta: { hidden: true, title: '项目预警' }
  }

]

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
